/**
 * @date 2005-12-6 13:17:08
 *
 */
package org.nanhill.commons.pattern;

import java.util.HashMap;
import java.util.Map;

/**
 * @author alin
 * 
 */
public class MapDepot<K, V> implements Depot<K, V> {
	private Map<K, V> depot;

	public MapDepot() {
		this.depot = new HashMap<K, V>();
	}

	public MapDepot(int cap) {
		this.depot = new HashMap<K, V>(cap);
	}

	public void add(K key, V cargo) {
		this.depot.put(key, cargo);
	}

	public V get(K key) {
		return this.depot.get(key);
	}

	public V remove(K key) {
		V v = this.depot.remove(key);
		return v;
	}

}
